<div ng-controller="DazheCtrl" ng-init="addAction()">
    <ul class="sui-breadcrumb">
        <li><a href="#/dazhe/list">{{'打折'| translate}}</a></li>
        <li class="active">
            {{!dazhe_activity_id?"创建":"edit"|translate}}
        </li>
    </ul>
    <form name="Tradeform" class="sui-form form-horizontal" novalidate>
        <div mywizard class="sui-steps">
            <step>
                <label><span class="round">1</span><span>活动设置</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <step ng-show="dazhe_data.ptype == 2">
                <label><span class="round">2</span><span>设置商品</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <step>
                <label><span class="round">{{dazhe_data.ptype == 1?2:3}}</span><span>完成</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <div stepcontent0 class="stepContent">
                <div class="stepbody">
                    <div class="control-group">
                        <label class="control-label v-top">
                            促销标题：
                        </label>
                        <div class="controls">
                            <input id="title" type="text" name="name" ng-model="dazhe_data.name" />
                            <div ng-show="dazhe_data.name.length==0 || dazhe_data.name.length>5" class="sui-msg msg-error msg-clear help-block error">
                                <div class="msg-con">活动标题不能超过5个字</div>
                                <s class="msg-icon"></s>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            起始时间：
                        </label>
                        <div class="controls">
                            <input id="start_time" ng-model="dazhe_data.start_time" datetimepicker name="start_time" value="2017-05-21 12:12:15" required>
                            <span class="float_left" style="width:10px;">至</span>
                            <input id="end_time" ng-model="dazhe_data.end_time" datetimepicker name="end_time" min-date="{{dazhe_data.start_time}}" required>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            绑定会员等级：
                        </label>
                        <div class="controls">
                            <span ng-if="dazhe_data.level">
                                <item-name type="'level'" ng-model="dazhe_data.level"></item-name>
                                <button class="sui-btn btn-link" ng-click="clearLevel()">清空会员等级</button>
                                <br />
                            </span>
                            <choose-level ng-model="dazhe_data.level" mult="no"></choose-level>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            活动范围：
                        </label>
                        <div class="controls">
                            <label data-toggle="radio" class="radio-pretty inline {{dazhe_data.ptype == 1?'checked':''}} {{dazhe_activity_id && dazhe_data.ptype == 2?'disabled':''}}">
                                <input type="radio" name="radio" ng-checked="{{dazhe_data.ptype==1}}" ng-disabled="{{dazhe_activity_id && dazhe_data.ptype==2}}" ng-model="dazhe_data.ptype" value="1"><span>全店商品参加</span>
                            </label>
                            <label data-toggle="radio" class="radio-pretty inline {{dazhe_data.ptype == 2?'checked':''}} {{dazhe_activity_id&&dazhe_data.ptype == 1?'disabled':''}}">
                                <input type="radio" name="radio" ng-model="dazhe_data.ptype" ng-checked="{{dazhe_data.ptype==2}}" ng-disabled="{{dazhe_activity_id&&dazhe_data.ptype==1}}" value="2"><span>部分商品参加</span>
                            </label>
                        </div>
                    </div>
                    <div class="control-group" ng-show="dazhe_data.ptype == 1">
                        <label class="control-label v-top">
                            优惠类型：
                        </label>
                        <div class="controls">
                            <ul id="tab-demo2" class="sui-nav nav-tabs nav-primary">
                                <li class="{{dazhe_data.type_id == 1?'active':''}}"><a href="#default" data-toggle="tab" ng-click="tabCut($event);changeType(1);">打折</a></li>
                                <li class="{{dazhe_data.type_id == 2?'active':''}}">
                                    <a href="#custom" data-toggle="tab" ng-click="tabCut($event);changeType(2)">
                                        减钱
                                    </a>
                                </li>
                            </ul>
                            <div class="tab-content">
                                <input type="hidden" ng-model="dazhe_data.type_id" />
                                <div id="default" class="tab-pane {{dazhe_data.type_id == 1?'active':''}}">
                                    打
                                    <input id="discount" type="text" name="discount" ng-model="dazhe_data.discount" />
                                    <span class="help-inline">折</span>
                                    <span class="help-block" style="color:#f00;">举例：填95代表100元商品95元销售；填50代表5折。</span>
                                </div>
                                <div id="custom" class="tab-pane {{dazhe_data.type_id == 2?'active':''}}">
                                    减
                                    <input id="disprice" type="text" name="disprice" ng-model="dazhe_data.disprice" /> 元
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <!-- {{!dazhe_activity_id && dazhe_edit?'':'zhide'}} -->
                    <button class="sui-btn btn-primary" ng-click="dazheAdd();" ng-show="dazhe_data.ptype == 1">{{!dazhe_activity_id?"save":"edit"|translate}}</button>
                    <button ng-show="dazhe_data.ptype == 2" type="button" id="next1" class="sui-btn btn-primary" mywizard-next ng-click="dazheAdd('part');">{{'Next step'|translate}}</button>
                </div>
            </div>
            <div stepcontent1 class="stepContent">
                <div class="stepbody">
                    <ul id="tab-demo" class="sui-nav nav-tabs nav-primary">
                        <li class="active"><a href="#default1" data-toggle="tab" ng-click="tabCut($event);checkedBroadcast();">已参加</a></li>
                        <li>
                            <a href="#custom1" data-toggle="tab" ng-click="tabCut($event);broadcast();">添加</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="default1" class="tab-pane active">
                            <checked-item-list></checked-item-list>
                        </div>
                        <div id="custom1" class="tab-pane">
                            <item-list></item-list>
                        </div>
                    </div>
                </div>
                <div>
                    <!-- <input type="button" class="sui-btn btn-primary" value="上一步" mywizard-previous /> -->
                    <button type="button" class="sui-btn btn-primary" mywizard-previous>上一步</button>
                    <a href="#/dazhe/list" class="sui-btn btn-primary"> 完成,返回列表页 </a>
                </div>
            </div>
            <div class="stepContent zhide">
                <div class="stepbody">
                    <div class="control-group">
                        <label class="control-label">{{'has_invoice'|translate}}：</label>
                        <div class="controls">
                            <bool-select ng-model="trade.has_invoice"></bool-select>
                        </div>
                    </div>
                    <div ng-show="trade.has_invoice">
                        <div class="control-group">
                            <label class="control-label">{{'invoice_type'|translate}}：</label>
                            <div class="controls">
                                <input type="text" name="invoice_type" value="" ng-model="trade.invoice_type" class="input-xlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">{{'title'|translate}}：</label>
                            <div class="controls">
                                <input type="text" name="invoice_title" value="" ng-model="trade.invoice_title" class="input-xlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">{{'invoice_fee'|translate}}：</label>
                            <div class="controls">
                                <input type="number" name="invoice_fee" value="" ng-model="trade.invoice_fee" class="input-xlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">{{'invoice_desc'|translate}}：</label>
                            <div class="controls">
                                <textarea type="text" name="invoice_desc" value="" ng-model="trade.invoice_desc" class="input-xlarge"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <button type="button" class="sui-btn btn-primary" mywizard-previous>{{'Last step'|translate}}</button>
                    <a href="#/dazhe/list" class="sui-btn btn-primary"> 完成,返回列表页 </a>
                </div>
            </div>
        </div>
    </form>
</div>